#include<iostream>

using std::cout;
using std::endl;
using std::cin;

class Complex
{
public:
    Complex(int real,int image)
    :_real(real)
     ,_image(image)
    {
        cout<<"构造"<<endl;
    }
    ~Complex()=default;
    Complex& operator++()
    {
        _real++;
        _image++;
        return *this;

    }
    Complex operator++(int)
    {
        Complex tem(*this);
        _real++;
        _image++;
        return tem; 
    }
friend std::ostream& operator<<( std::ostream& ost,const Complex& val);
    void print()
    {
        cout<<_real<<" + "<<_image<<"i"<<endl;
    }
private:
    int _real;
    int _image;
};
std::ostream& operator<<(std::ostream& ost,const Complex& val)
{
        ost<<val._real<<" + "<<val._image<<"i"<<endl;
        return ost;
}
int main()
{
    Complex val(4,2);
    cout<<val<<endl;
    cout<<val++<<"   "<<endl<<val<<endl<<++val<<endl;
}
